package com.iqiyi.pps.epg.web.timer;

import com.iqiyi.pps.epg.core.service.channel.ChannelService;
import com.iqiyi.pps.epg.core.utils.TVMaoUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class ProgramListTrigger {
    private static Logger logger = LoggerFactory.getLogger(ProgramListTrigger.class);
    @Autowired
    private ChannelService channelService;

    public void task() {
        logger.debug("[ProgramListTrigger][task] start");
        List<String> codeList = getCodeList();
        TVMaoUtil.doQueryProgram(codeList, 5);
    }

    private List<String> getCodeList() {
        List<String> codeList = channelService.getChannelBaseCodeList();
        return codeList;
    }

}
